<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" class="num" name="row[num]" value="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Garden')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[garden_number]', $gardenData, null, ['class'=>'form-control selectpicker garden', 'id' => 'garden', 'data-rule'=>'required'])}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Building')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="building form-control" name="row[building_number]" data-rule="required">
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Floor')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="floor form-control" name="row[floor]" data-rule="required">
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Number')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-number" class="form-control" name="row[number]" type="text" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label for="c-dorm-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[type]', $typeData, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-dorm-type" class="control-label col-xs-12 col-sm-2">{:__('Category')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[category]', $categoryData, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-bed-count" class="control-label col-xs-12 col-sm-2">{:__('Bed Count')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-bed-count" class="form-control" name="row[bed_count]" type="text" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label for="c-price" class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price" class="form-control" name="row[price]" type="text" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('Save')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script id="buildingTpl" type="text/html">
    <option value="" data-id="0">请选择</option>
    <%for(var i=0; i< data.length; i++){%>
        <option value="<%=data[i].value%>" data-id="<%=data[i].id%>"><%=data[i].name%></option>
    <%}%>
</script>

<script id="floorTpl" type="text/html">
    <option value="">请选择</option>
    <%for(var i = 1; i <= floor_count; i++){%>
    <option value="<%=i%>"><%=i%>楼</option>
    <%}%>
</script>
